namespace IrisGenerator.Common.DatabaseModel.DataAccess {
    using System;
    using System.Collections.Generic;
    using System.Data.SqlClient;
    using System.Configuration;
    using System.Data;
    using System.Xml;
    using IrisGenerator.Dal;
    
    
    public partial class Database : IDisposable {
        
        private DataAccess _dataAccess;
        
        public Database() {
            this._dataAccess = new DataAccess();
        }
        
        public virtual System.Data.DataSet DATABASE_Select_All() {
            this._dataAccess.CreateProcedureCommand("sp_DATABASE_Select_All");
            DataSet value = this._dataAccess.ExecuteDataSet();
            return value;
        }
        
        public virtual System.Data.DataSet DATABASE_Select_One(System.Nullable<System.Guid> DB_ID) {
            this._dataAccess.CreateProcedureCommand("sp_DATABASE_Select_One");
            this._dataAccess.AddParameter("DB_ID", DB_ID, ParameterDirection.Input);
            DataSet value = this._dataAccess.ExecuteDataSet();
            return value;
        }
        
        public virtual System.Nullable<System.Guid> DATABASE_Insert(string DB_NAME, string DB_FORMATED_NAME) {
            this._dataAccess.CreateProcedureCommand("sp_DATABASE_Insert");
            this._dataAccess.AddParameter("DB_NAME", DB_NAME, ParameterDirection.Input);
            this._dataAccess.AddParameter("DB_FORMATED_NAME", DB_FORMATED_NAME, ParameterDirection.Input);
            Guid value = ((Guid)(this._dataAccess.ExecuteScalar()));
            return value;
        }
        
        public virtual System.Nullable<int> DATABASE_Delete(System.Nullable<System.Guid> DB_ID) {
            this._dataAccess.CreateProcedureCommand("sp_DATABASE_Delete");
            this._dataAccess.AddParameter("DB_ID", DB_ID, ParameterDirection.Input);
            int value = this._dataAccess.ExecuteNonQuery();
            return value;
        }
        
        public virtual System.Nullable<int> DATABASE_Update(System.Nullable<System.Guid> DB_ID, string DB_NAME, string DB_FORMATED_NAME) {
            this._dataAccess.CreateProcedureCommand("sp_DATABASE_Update");
            this._dataAccess.AddParameter("DB_ID", DB_ID, ParameterDirection.Input);
            this._dataAccess.AddParameter("DB_NAME", DB_NAME, ParameterDirection.Input);
            this._dataAccess.AddParameter("DB_FORMATED_NAME", DB_FORMATED_NAME, ParameterDirection.Input);
            int value = this._dataAccess.ExecuteNonQuery();
            return value;
        }
        
        public virtual void Dispose() {
            if ((this._dataAccess != null)) {
                this._dataAccess.Dispose();
            }
        }
    }
}
